In a video communication application, a compression degree of a video image is closely related to transmission channel bandwidth of the video image. That is, after an encoder encodes the video image, a bit rate of an obtained compressed code stream cannot exceed the transmission channel bandwidth. Otherwise, code stream data may be lost, thereby resulting in poor quality of a video image decoded by a decoder. Therefore, the encoder generally encodes the video image by using a certain encoding method, so as to ensure that the bit rate of the obtained compressed code stream does not exceed the transmission channel bandwidth.
H.264 is a video codec standard established by the International Telecommunication Union Telecommunication Standardization Sector. Currently, almost all video devices support the H.264 codec standard. When the transmission channel bandwidth is high, the quality of a video image encoded by an encoder according to the H.264 standard can be better ensured, and the compression impairment of the video image is not obvious. However, when the transmission channel bandwidth is low, the compression degree of the video image encoded by the encoder according to the H.264 standard is higher. Accordingly, the compression impairment of the video image is larger, thereby resulting in lower quality of the video image decoded by the decoder. In a practical application, when the transmission channel bandwidth is low, a quantization parameter QP value in the encoder commonly increases during encoding according to the H.264 standard to ensure that the bit rate of the compressed code stream after being encoded according to the H.264 standard does not exceed the transmission channel bandwidth. The greater the QP value is, the smaller the bit rate of the compressed code stream after being encoded according to the H.264 standard is, and the larger the compression impairment of the video image is. This leads to poorer quality of the video image decoded by the decoder. For example, image blocking artifact is obvious, motion streaking is serious, a pit exists, a false edge exists, and color distortion exists.
Therefore, how to improve the compression quality of a video image when transmission channel bandwidth is low is an important research direction.